import dbconn from "../dbconn";
import logger from "@utils/log";

/**
 * 将登录超时的状态至为N
 */
export default async function updateLoginStatus(): Promise<void> {
  let sql =
    " update LoginStatus set login_status = 'N' where DATEDIFF(hour,last_login,getdate()) >= 2 and login_status = 'Y'";
  try{
    await dbconn.execute({ sql });
  }catch(err){
    logger.error("Error--updateLoginStatus:"+err)
  }
}
